import dateFormat from 'dateformat'

function format(date: number, formatStr: string) {
  if (!date) {
    return dateFormat(new Date(), formatStr)
  }
  return dateFormat(new Date(date), formatStr)
}

export { format }
